home *** CD-ROM | disk | FTP | other *** search
/ Game Programming in C++ - Start to Finish / GameProgrammingS.iso / developer_install / CEGUISDK-0.4.1-VC6-STLport.exe / {app} / Samples / common / src / CEGuiRendererSelector.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2005-03-10  |  2.8 KB  |  70 lines

  1. /************************************************************************
  2.     filename:   CEGuiRendererSelector.cpp
  3.     created:    24/9/2004
  4.     author:     Paul D Turner
  5. *************************************************************************/
  6. /*************************************************************************
  7.     Crazy Eddie's GUI System (http://www.cegui.org.uk)
  8.     Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
  9.  
  10.     This library is free software; you can redistribute it and/or
  11.     modify it under the terms of the GNU Lesser General Public
  12.     License as published by the Free Software Foundation; either
  13.     version 2.1 of the License, or (at your option) any later version.
  14.  
  15.     This library is distributed in the hope that it will be useful,
  16.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18.     Lesser General Public License for more details.
  19.  
  20.     You should have received a copy of the GNU Lesser General Public
  21.     License along with this library; if not, write to the Free Software
  22.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  23. *************************************************************************/
  24. #include "CEGuiRendererSelector.h"
  25.  
  26.  
  27. /*************************************************************************
  28.     Constructor.
  29. *************************************************************************/
  30. CEGuiRendererSelector::CEGuiRendererSelector()
  31. {
  32.     d_lastSelected = InvalidGuiRendererType;
  33.  
  34.     // make all renderer types un-available.  sub-classes should enable appropriate types.
  35.     for (int i = 0; i < RendererTypeCount; ++i)
  36.     {
  37.         d_rendererAvailability[i] = false;
  38.     }
  39. }
  40.  
  41.  
  42. /*************************************************************************
  43.     Destructor.
  44. *************************************************************************/
  45. CEGuiRendererSelector::~CEGuiRendererSelector()
  46. {}
  47.  
  48.  
  49. /*************************************************************************
  50.     Return the CEGuiRendererType value of the renderer most recently
  51.     selected by the user.
  52. *************************************************************************/
  53. CEGuiRendererType CEGuiRendererSelector::getSelectedRendererType()
  54. {
  55.     return d_lastSelected;
  56. }
  57.  
  58.  
  59. /*************************************************************************
  60.     Set whether or not a specific renderer type will be available for
  61.     selection from the dialog the next time it is displayed.
  62. *************************************************************************/
  63. void CEGuiRendererSelector::setRendererAvailability(CEGuiRendererType rendererType, bool available)
  64. {
  65.     if (rendererType < RendererTypeCount)
  66.     {
  67.         d_rendererAvailability[rendererType] = available;
  68.     }
  69. }
  70.